<template>
  <div class="app-container">
    <el-table :data="processList">
      <el-table-column label="id" prop="id"></el-table-column>
      <el-table-column label="流程Key" prop="processKey"></el-table-column>
      <el-table-column label="流程名称" prop="processName"></el-table-column>
      <el-table-column label="最新版本号" prop="version"></el-table-column>
      <el-table-column label="状态" prop="status"></el-table-column>
      <el-table-column label="创建人" prop="createBy"></el-table-column>
      <el-table-column label="创建时间" prop="createTime"></el-table-column>
      <el-table-column label="操作" width="180">
        <template #default="scope">
          <el-button type="text" @click="handleEdit(scope.row)">编辑</el-button>
          <el-button type="text" @click="handleDelete(scope.row)">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <pagination v-show="total > 0"  background layout="prev, pager, next" :total="total" />
  </div>
</template>

<script setup>
import { ref } from 'vue'
import { selectWorkflowBpmnPage } from '@/api/workflow/processManager.js'

const processList = ref([])
const total = ref(0);
const pageNum = ref(1);
const pageSize = ref(10);

const query = ref({});

onMounted(() => {
  query.value = {
    pageNum: pageNum.value,
    pageSize: pageSize.value,
  }
  selectWorkflowBpmnPage(query.value).then(res => {
    console.log(res)
    processList.value = res.rows
    total.value = res.total;
  })
})

</script>


<style scoped lang="scss">

</style>